package top.zhmq.userconsumer.service;


import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import top.zhmq.commonmodule.model.User;
import top.zhmq.userconsumer.hystrix.UserServiceHystrix;

/**
 *
 *
 * @author Glory
 * @classname UserService
 * @create 2021-06-01 14:38
 */

@Component
@FeignClient(value = "shop-user-provider", fallback = UserServiceHystrix.class)
public interface UserService {
    @RequestMapping(value = "/login", method = RequestMethod.GET)
    User login(@RequestParam(value = "uname") String uname);

    @RequestMapping(value = "/register", method = RequestMethod.GET)
    int register(@RequestParam(value = "upassword") String upassword,
                 @RequestParam(value = "uname") String uname,
                 @RequestParam(value = "usex") String usex,
                 @RequestParam(value = "uemail") String uemail);

    @RequestMapping(value = "/active", method = RequestMethod.GET)
    int active(@RequestParam(value = "uname") String uname,
               @RequestParam(value = "ucode") String ucode);
}
